# 4-valued Dunn/Belnap logic, defined in mvl-toolkit by Koen Lefever 2009-2010, GPL v.3 licensed

from Logic import *

class B4(Logic):
    """Dunn/Belnap logic"""
    def __init__(self, truth_values_list = ['{}', '{0}', '{1}', '{0,1}'], designated_values_list = ['{1}', '{0,1}']):
        if not len(truth_values_list) == 4:
            raise ValueError('B4 is a 4-valued logic, please provide four truth values.')
        if not len(designated_values_list) == 2:
            raise ValueError('Please provide exactly two designated values for B4.')
        Logic.__init__(self, truth_values_list, designated_values_list)

    def INTERSECTION(self, P, Q):
        return self.operator(1116699, P, Q)

